﻿
@{
    ViewBag.Title = "ZhuCe";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Content/js/jquery-1.8.2.min.js"></script>
<div class="reg-main-box">
    <div class="reg-main">
        <div class="reg-title">
            <h3 id="two1" onmouseover="setContentTab(&#39;two&#39;,1,3)" class="active">个人买家注册</h3>
        </div>


        <!--个人登录-->
        <div class="reg-content" id="con_two_1" style="display: block;">
            <ul>
                <li><i>*</i>&nbsp;&nbsp用户名:&nbsp<input type="text" id="CustName"></li>
                <li><i>*</i>&nbsp;登录密码:<input type="password" id="Pwd"></li>
                <li><i>*</i>&nbsp密码确认:<input type="password" id="NewPwd"></li>
                <li><i></i>&nbsp手机号码:<input type="text" id="Phone"></li>
                <li><input type="checkbox" checked="checked" class="reg-checkbox"><a href="">已阅读会员服务协议选项(带*号必填)</a></li>
                <li><button type="button" id="btn">注册</button></li>
            </ul>
        </div>
    </div>
</div>
<input type="hidden" id="Sex" value="保密" />
<script>

    $("#btn").click(function () {
        var CustName = $("#CustName").val();
        var Pwd = $("#Pwd").val();
        var Sex = $("#Sex").val();
        if (CustName == "" || Pwd == "") {
            alert("带*号必填")
        } else {
            var NewPwd = $("#NewPwd").val();
            if (Pwd != NewPwd) {
                alert("密码不一致")
            } else {
                $.post("/Login/Register", { CustName: $("#CustName").val(), Pwd: Pwd, Phone: $("#Phone").val(), Sex:Sex }, function (res) {
                    if (res.Success) {
                        alert(res.Message)
                        window.location.href = "/Login/Index"
                    } else {
                        alert(res.Message)
                    }

                })
            }
        }


        
        



    })


</script>